import type { FolderReader } from "../tools/translate";
import { PackageConfig } from "./config";

export type PackageScriptsConfig = {
  server: {
    /**
     * 绝对路径
     */
    base: string;
    npmPackages: "server" | "client" | undefined;
    entry: string;
    development: boolean;
    webpack?: string;
    output: string;
    esbuild?: boolean;
  };
  client: {
    /**
     * 绝对路径
     */
    base: string;
    npmPackages: "server" | "client" | undefined;
    entry: string;
    development: boolean;
    webpack?: string;
    output: string;
    esbuild?: boolean;
  };
  jsUpdate?: boolean;
  outputNameList?: Record<string, any>;
};

export type ScriptsConfig = {
  /**
   * 基本目录，ts项目根目录
   * **要求绝对路径！！！**
   */
  baseDir: string;
  /**
   * 临时目录
   */
  tempDir: string;
  /**
   * 是否为当前端的npm包
   */
  npmPackages: "server" | "client" | undefined;
  /**
   * 输出目录，打包后的js目录
   * @deprecated
   */
  distDir?: string;
  /**
   * 目录阅读器
   */
  folderReader: FolderReader;
  /**
   * 项目入口文件
   */
  entry: string;
  /**
   * 输出文件
   */
  output: string;
  /**
   * 是否为开发模式
   */
  development?: boolean;
  type: "server" | "client";
  webpack?: string;
  jsUpdate?: boolean;
  outputNameList?: Record<string, any>;

  esbuild?: boolean;
};
